<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>欢迎光临 Music Store</title>
	<link type="text/css" rel="Stylesheet" href="${pageContext.request.contextPath }/style/front.css"/>
	<script src="${pageContext.request.contextPath}/script/jquery-1.10.2.js"></script>
	<script src="${pageContext.request.contextPath}/script/jquery.validate.js"></script>
	<script>
		$(function(){
			 $("#form").validate({
				rules:{
					username:{
						required:true
					},
					password:{
						required:true
					}
				},
				messages:{
					username:{
						required:"请输入用户名"
					},
					password:{
						required:"请输入密码"
					}
				}
			}); 
		});
	</script>
 	<style>
 		#main table{margin:10px 30px;}
 		#main table td{padding-bottom:5px;}
 	</style>
  </head>
  <body>
    <div id="wrapper">
    	<s:action name="header" executeResult="true" namespace="/"></s:action>
    	<div id="content">
    		<s:action name="sidebar" executeResult="true" namespace="/"></s:action>
    		<div id="main">
    			<h3 id="main-title">用户登录</h3>
    			<form action="login" method="post" id="form">
    				<table>
    				<tr>
    					<td>用户名：</td>
    					<td><input type="text" name="username"/></td>
    				</tr>
    				<tr>
    					<td>密码：</td>
    					<td><input type="password" name="password"/></td>
    				</tr>
    				<c:if test="${not empty error }">
    					<tr>
    					<td></td>
    					<td><label class="error">${error }</label></td>
    				</tr>
    				</c:if>
    				<tr>
    					<td></td>
    					<td><input type="submit" value="登录" id="click"/>&nbsp;&nbsp;&nbsp;<a href="registerAction">注册</a></td>
    				</tr>
    			</table>
    			</form>
    		</div>
    		<div class="clearBoth"></div>
    	</div>
    	<%@ include file="../shared/footer.jsp" %>
    </div>
  </body>
</html>
